package com.ksyun.cloudhostalarmprocessing;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

import java.security.PublicKey;

@SpringBootApplication
@EnableScheduling
@EnableAsync
public class CloudHostAlarmProcessingApplication {

    public static void main(String[] args) {
        SpringApplication.run(CloudHostAlarmProcessingApplication.class, args);
    }

    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    @Bean
    public RestHighLevelClient getrestHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://8.149.130.43:9200")
        ));
        return client;
    }

}
